<?php
/*
Copyright (C) 2009 de Flotte Maxence

This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
?>
<?php
/**
 ************************
 **** Must be delete ****
 ************************
 */
include_once './ZzL/generation.php';

function genZzG2($ZzS,$FileZzS) {

	ob_start();
	$_label['user'] = 0;
	$_label['group'] = 0;
	$_label['id'] = 1;
	$_label['name'] = '';
	$_label['type'] = '';
	$_label['dateC'] = 0;
	$_label['dateU'] = 0;
	$_label['userW'] = 1;
	$_label['groupW'] = 1;
	$_label['otherW'] = 1;
	$_label['userR'] = 1;
	$_label['groupR'] = 1;
	$_label['otherR'] = 1;
	$_label['puZZleName'] = '';
	$_label['ZzS'] = $ZzS;
	
	$gen = createStaticpuZZle($_label);

	$open = fopen('./ZzG/'.$FileZzS.'.php', "w");
	fwrite($open, $gen);
	fclose($open);

	include './ZzG/'.$FileZzS.'.php';
}

function createStaticpuZZle2($ZzS) {

	$return = '';

	$ZzS = str_replace("\n","",$ZzS);
	$ZzS = str_replace("\r","",$ZzS);
	$return .= '$page = new page("page");'."\n";
	if(@$noStructure) '$Page->setNoStructure(\'true\');';
	//$ListObject = Array('page'=>array('main'=>$Page));
	$Cursor = 0;
	$line = 1;
	$_ZzO = array();

	$length = strlen($ZzS);
	while(($instruction = convertInstruction($ZzS,$Cursor,$line, $length,$LastObjectCall, $_ZzO)) !== false) {
		$return .= $instruction;
	}

	$return .= 'echo $page->buildStaticpuZZle();'."\n";
	$return .= '$GLOBALS[\'noCache\'] = $page->noCache;'."\n";
	//$return .= '//$GLOBALS[\'MySql\']->close();'."\n";
/*	 $return .= '?>';*/
	return $return;
}

?>